<template>
  <div class="sliderstyle">
      <!-- 基本属性 -->
      <el-divider content-position="left">基本属性</el-divider>
    
    <!-- 滑块编辑选项 -->
    <el-form label-width="90px" label-position="left" size="small">
      <el-form-item label="默认值">
        <el-input-number v-model="datas.value" :min="datas.min" :max="datas.max" :step="datas.step"></el-input-number>
      </el-form-item>
      
      <el-form-item label="数值范围">
        <el-input-number v-model="datas.min" placeholder="最小值" style="width: 120px; margin-right: 10px"></el-input-number>
        <el-input-number v-model="datas.max" placeholder="最大值" style="width: 120px"></el-input-number>
      </el-form-item>
      
      <el-form-item label="步长">
        <el-input-number v-model="datas.step" :min="0.1" :precision="1"></el-input-number>
      </el-form-item>
      
      <el-form-item label="宽度">
        <el-input v-model="datas.width" placeholder="例如：100%"></el-input>
      </el-form-item>
      
      <el-form-item label="颜色设置">
        <div style="display: flex; align-items: center; margin-bottom: 10px;">
          <span style="width: 80px; margin-right: 10px;">进度条颜色:</span>
          <el-color-picker v-model="datas.activeColor"></el-color-picker>
        </div>
        <div style="display: flex; align-items: center;">
          <span style="width: 80px; margin-right: 10px;">背景颜色:</span>
          <el-color-picker v-model="datas.backgroundColor"></el-color-picker>
        </div>
      </el-form-item>
      
      <el-form-item label="模式设置">
        <el-checkbox v-model="datas.vertical">竖向模式</el-checkbox>
      </el-form-item>
      
      <el-form-item label="竖向高度" v-if="datas.vertical">
        <el-input v-model="datas.height" placeholder="例如：200px"></el-input>
      </el-form-item>
      
      <el-form-item label="其他选项">
        <el-checkbox v-model="datas.showStops">显示间断点</el-checkbox>
        <el-checkbox v-model="datas.showInput">显示输入框</el-checkbox>
        <el-checkbox v-model="datas.range">范围选择</el-checkbox>
        <el-checkbox v-model="datas.disabled">禁用状态</el-checkbox>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'sliderstyle',
  props: {
    datas: Object,
    'data-type': String,
  },
}
</script>

<style scoped lang="less">
.sliderstyle {
  width: 100%;
  box-sizing: border-box;
  
  /* 标题 */
  h2 {
    padding: 24px 16px 24px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #f2f4f6;
    font-size: 18px;
    font-weight: 600;
    color: #323233;
  }
}
</style> 